package Comprehensive_01;

public class Demo1 {
    public static void main(String[] args) {
        int[] arr = {2, 4, 3, 6, 4, 7, 1, 8, 3, 9};
        int max = arr[0];
        int min = arr[0];
        /*for (int i = 1; i < arr.length; i++) {
            max = max > arr[i] ? max : arr[i];
            min = min < arr[i] ? min : arr[i];
        }*/
        for (int i : arr) {
            max = Math.max(max,i);
            min = Math.min(min,i);
        }
        System.out.println(max);
        System.out.println(min);
    }
}
